package com.xiaowen.controller;

import com.xiaowen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by 15c on 2018/5/18.
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private
    UserService userService;
    @RequestMapping(value = "/show",method = RequestMethod.GET)
    public String showAUser(Model model){
        model.addAttribute("user",userService.showAUserById(1));
        return "/test/user";
    }
}
